package com.cxj.g8llk;

import org.loon.framework.android.game.core.graphics.opengl.LTexture;
import org.loon.framework.android.game.core.resource.LPKResource;
import org.loon.framework.android.game.media.AssetsSound;
import org.loon.framework.android.game.utils.GraphicsUtils;

public class RSL {
    LTexture[] images;
    LTexture[] kills;
    AssetsSound[] sounds;

    private static RSL instance = new RSL();

    private RSL() {
        images = new LTexture[17];
        for (int i = 0; i < 8; i++) {
            images[i] = GraphicsUtils.loadImage("assets/grid/" + i + ".gif", false).getTexture();
        }

        final String res = "res/res.lpk";

        images[8] = LPKResource.openImage(res, "a0.png").getTexture();
        images[9] = LPKResource.openImage(res, "dot.png").getTexture();
        images[10] = LPKResource.openImage(res, "background.jpg").getTexture();
        images[11] = LPKResource.openImage(res, "role0.png").getTexture();
        images[12] = LPKResource.openImage(res, "role1.png").getTexture();
        images[13] = LPKResource.openImage(res, "role2.png").getTexture();
        images[14] = LPKResource.openImage(res, "win.png").getTexture();
        images[15] = LPKResource.openImage(res, "start.png").getTexture();
        images[16] = LPKResource.openImage(res, "gameover.png").getTexture();

        kills = new LTexture[5];
        for (int i = 0; i < 5; i++) {
            kills[i] = GraphicsUtils.loadImage("assets/animation/" + i + ".png", false).getTexture();
        }

        sounds = new AssetsSound[10];
        for (int i = 0; i < 10; i++) {
            sounds[i] = new AssetsSound("sound/sound" + (i + 1) + ".mp3");
        }
    }

    public static RSL one() {
        return instance;
    }

    public LTexture getImage(int i) {
        return images[i];
    }

    public LTexture getKill(int i) {
        return kills[i];
    }

    public AssetsSound getSound(int i) {
        return sounds[i];
    }
}
